package com.qing.demo02.mapper;

import com.qing.demo02.entity.UserInfo;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserInfoMapperImpl implements UserInfoMapper {


	//我们的所有操作，都是用sqlSession来执行，在原来，现在都使用SqlSessionTemplate；
	private SqlSessionTemplate sqlSession;

	public void setSqlSession(SqlSessionTemplate sqlSession) {
		this.sqlSession = sqlSession;
	}

	@Override
	public List<UserInfo> selectUser() {
		UserInfoMapper userInfoMapper = sqlSession.getMapper(UserInfoMapper.class);
		return userInfoMapper.selectUser();
	}

	@Override
	public int addUser(UserInfo userInfo) {
		return 0;
	}

	@Override
	public int deleteUser(int id) {
		return 0;
	}
}
